package com.ndp.fb.walle.model.vo.eventnotificationmessage;

import com.ndp.fb.enums.message.ChannelType;
import com.ndp.fb.enums.message.EventNotificationType;
import com.ndp.fb.enums.message.MessageStatus;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * Created by hermen.he on 2015/7/30.
 */
@Setter
@Getter
@NoArgsConstructor
public class EventNotificationMessageVo  {

    //编号
    private Long id;
    //消息体
    private String body;
    //消息发送者(user ticket)
    private String sender;
    //消息接收者(user ticket)
    private String receiver;
    //消息发送时间
    private Long sendTime;
    // 消息状态
    private MessageStatus status;
    //事件通知类型
    private EventNotificationType eventType;

    //是否需要功能跳转
    private boolean isNeedFunctionJump = false;

    //消息跳转url
    private String url;

    private String eventKey;
    private String eventValues;

    /**
     * 消息是否阅读
     * <ul>
     * <li>0:未读</li>
     * <li>1:已读</li>
     * </ul>
     */
    private Integer isRead =0;

    //消息有效期
    private Long expiredTime;
    //渠道
    private ChannelType channel;

    private String title;


    public boolean isNeedFunctionJump() {
        return isNeedFunctionJump;
    }


    public void setIsNeedFunctionJump(boolean needFunctionJump) {
        isNeedFunctionJump = needFunctionJump;
    }

    public void setStatus(int status){
        if( status == 1){
            this.status = MessageStatus.NORMAL;
        }else{
            this.status = MessageStatus.DELETEED;
        }

    }

}
